package com.yawn;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * @author Created by yawn on 2017-12-09 16:17
 */
public class TestDeleteDeployment {

    public static void main(String[] args) {

        ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
        RepositoryService repository = engine.getRepositoryService();
        /// 部署后，从数据库找到deploymentId，再根据id删除即可
        // 部署
//        Deployment deployment = repository.createDeployment().addClasspathResource("delete.bpmn").deploy();
        // 删除（如果设置为级联删除，还会删除流程实例、流程任务、以及历史数据）
        repository.deleteDeployment("22501", true);

        engine.close();
    }
}
